package br.jus.tjpe.negocio;

import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;

@MessageDriven(activationConfig = {
		@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(propertyName = "destinationJndiName", propertyValue = "jms/myQueue") })
public class MessageConsumer implements MessageListener {

	public void onMessage(Message msg) {
		System.out.println(this.getClass().getName() + " called ...");
		try {
			System.out.println(msg.getStringProperty("mensagem"));
		} catch (JMSException e) {
			e.printStackTrace();
		}

	}

}
